package javaer.starter.model;

import com.google.common.collect.Lists;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.util.List;

/**
 * 模块
 *
 * @author yangzhen
 * @date 2023/6/5 10:56
 * @since 1.0.0
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class ModuleModel extends BaseModel {

    public static final String SQL_TEMPLATE = "insert into starter_module (type_id, module_id, module_name, required, starter, gmt_create, gmt_modified) values ";

    public static final String SQL_NAME = "starter_module.sql";

    /**
     * 脚手架类型唯一标识
     */
    String typeId;
    /**
     * 模块唯一标识
     */
    String moduleId;
    /**
     * 模块名称
     */
    String moduleName;
    /**
     * 必选，1：必选；0：非必选
     */
    Integer required;
    /**
     * 启动模块，1：是；0：否
     */
    Integer starter;

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getModuleId() {
        return moduleId;
    }

    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public Integer getRequired() {
        return required;
    }

    public void setRequired(Integer required) {
        this.required = required;
    }

    public Integer getStarter() {
        return starter;
    }

    public void setStarter(Integer starter) {
        this.starter = starter;
    }

    @Override
    public List<Object> getSqlValues() {
        return Lists.newArrayList(
                this.typeId,
                this.moduleId,
                this.moduleName,
                required,
                starter,
                this.getGmtCreate(),
                this.getGmtModified()
        );
    }
}